home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / disp182a.zip / DRVSRC / CIRRUS54.ASM < prev    next >
Assembly Source File  |  1993-11-21  |  16KB  |  432 lines

  1. ;--------------------------------------------------------------------------
  2. ; This is file CIRRUS.ASM
  3. ;
  4. ; Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  5. ; Copyright (C) 1992 Csaba Biegl, 820 Stirrup Dr, Nashville, TN 37221
  6. ; Copyright (C) 1993 Hartmut Schirmer, Feldstr. 118, 2300 Kiel 1, Germany
  7. ; Copyright (C) 1993 Ben Jos Walbeehm, Lijsterbeslaan 20, 5248 BB Rosmalen,
  8. ;                                                                 Netherlands
  9. ;
  10. ; This file is distributed under the terms listed in the document
  11. ; "copying.dj", available from DJ Delorie at the address above.
  12. ; A copy of "copying.dj" should accompany this file; if not, a copy
  13. ; should be available from where this file was obtained.  This file
  14. ; may not be distributed without a verbatim copy of "copying.dj".
  15. ;
  16. ; This file is distributed WITHOUT ANY WARRANTY; without even the implied
  17. ; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. ;--------------------------------------------------------------------------
  19. ; 64K mode added by J.Dittrich dittrich@ifk20.mach.uni-karlsruhe.de
  20. ; 16M mode doesn't work!     ***!!!***  But it does!  See below (BJW).
  21. ;--------------------------------------------------------------------------
  22. ; A number of modes (the 2Mb-video-RAM modes amongst others) added by 
  23. ; B.J. Walbeehm (Walbeehm@fsw.ruu.nl).
  24. ;
  25. ; NOTE:  The 16M mode can be made to work properly when using DISP V1.57
  26. ; =====  or better! To accomplish this, put the following two lines in the
  27. ;        "Bytes per line scan table for TrueColour Mode" (see CONFIG.DIS):
  28. ;            bytes_per_line_true=0,2048
  29. ;            bytes_per_line_true=3,2048
  30. ;--------------------------------------------------------------------------
  31. ;
  32. ; This driver supports Cirrus CL-GD542X Chipsets
  33. ; Check your BIOS documentation if all of below modes are supported !
  34. ;
  35. include grdriver.inc
  36. cseg    segment byte public 'code'
  37.     assume  cs:cseg, ds:cseg, es:cseg, ss:nothing
  38.  
  39.  
  40. ;--------------------------------------------------------------------------
  41. ; DRIVER HEADER
  42. ;  The following entries MUST match the structure and constant
  43. ;  declarations in the file 'grdriver.h' of the GRX graphics library
  44. ;  The mode word should contain the following bitfields:
  45. ;     - the GRD_NEW_DRIVER bit set for any new format driver
  46. ;     - the adapter type field should be specified
  47. ;     - the memory size field should be specified
  48. ;     - the paging mode field should be specified
  49. ;  The mode set routine will OR in the plane bitfield as it will
  50. ;  change when different color number modes are requested.
  51. ;--------------------------------------------------------------------------
  52.  
  53.     dw      offset mode_set_routine
  54.     dw      offset paging_routine
  55. mode_W  dw      GRD_NEW_DRIVER+GRD_VGA+GRD_1024K+GRD_NO_RW
  56. ;
  57. ; The 'def_xx' fields are filled in by go32 from the corresponding
  58. ; fields of the 'GO32' environment variable
  59. ;
  60. def_tw  dw      80              ; text width
  61. def_th  dw      25              ; text height
  62. def_gw  dw      640             ; graphics width
  63. def_gh  dw      480             ; graphics height
  64. def_nc  dw      16              ; graphics colors
  65.     dw      offset driver_init_routine
  66.     dw      offset text_mode_table
  67.     dw      offset graphics_mode_table
  68.  
  69. ;
  70. ; Biggest text and graphics sizes
  71. ;
  72. Max_TW  equ     132
  73. Max_TH  equ     50
  74. Max_GWn equ     800             ; non interlaced!!!
  75. Max_GHn equ     600
  76. Max_GW  equ     1280            ; may be interlaced
  77. Max_GH  equ     1024
  78.  
  79.  
  80. ;--------------------------------------------------------------------------
  81. ; TABLE OF SUPPORTED TEXT MODES
  82. ;       - keep sorted by size
  83. ;       - end with an all 0 entry
  84. ;       - BIOS field = 0xff disables it
  85. ;       - fields:
  86. ;               width,  height, colors, BIOS#+  setup_procedure_index*256
  87. ;--------------------------------------------------------------------------
  88. text_mode_table         label word
  89.     dw      80,     25,      2,     007h +  00000h
  90.     dw      40,     25,     16,     001h +  00000h ; also: mode 000h
  91.     dw      40,     50,     16,     001h +  00100h ; also: mode 000h *
  92.     dw      80,     25,     16,     003h +  00000h ; also: mode 002h
  93.     dw      80,     50,     16,     003h +  00100h ; also: mode 002h *
  94.     dw     132,     25,     16,     014h +  00000h ; also: mode 055h
  95.     dw     132,     43,     16,     054h +  00000h
  96.     dw     132,     50,     16,     014h +  00100h ; also: mode 055h *
  97.     dw       0,      0,      0,     000h +  00000h
  98.  
  99.  
  100. ;--------------------------------------------------------------------------
  101. ; TABLE OF SUPPORTED GRAPHICS MODES
  102. ;       - keep sorted first by colors then by size
  103. ;       - end with an all 0 entry
  104. ;       - BIOS field = 0xff disables it
  105. ;       - fields:
  106. ;               width,  height, colors, BIOS#+  setup_procedure_index*256
  107. ;--------------------------------------------------------------------------
  108. graphics_mode_table     label word
  109.     dw      640,    200,      2,    006h +  00000h
  110.     dw      640,    350,      2,    00fh +  00000h
  111.     dw      640,    480,      2,    011h +  00000h
  112.  
  113.     dw      320,    200,      4,    005h +  00000h
  114.  
  115.     dw      320,    200,     16,    00dh +  00000h
  116.     dw      640,    200,     16,    00eh +  00000h
  117.     dw      640,    350,     16,    010h +  00000h
  118.     dw      640,    480,     16,    012h +  00000h
  119.     dw      800,    600,     16,    058h +  00000h ; also: mode 06ah
  120.     dw     1024,    768,     16,    05dh +  00000h
  121.     dw     1280,   1024,     16,    06ch +  00000h
  122.  
  123.     dw      320,    200,    256,    013h +  00000h
  124.     dw      640,    480,    256,    05fh +  00000h
  125.     dw      800,    600,    256,    05ch +  00000h
  126.     dw     1024,    768,    256,    060h +  00000h
  127. TwoMegMode1             label word
  128.     dw     1280,   1024,    256,    06dh +  00000h ; requires 2 Mb !!!
  129.  
  130.     dw      640,    480,  32768,    066h +  00000h
  131.     dw      800,    600,  32768,    067h +  00000h
  132.  
  133.     dw    320,    200, 0c010h,    06fh +    00000h
  134.     dw    640,    480, 0c010h,    064h +  00000h 
  135.     dw    800,    600, 0c010h,    065h +  00000h
  136. TwoMegMode2             label word
  137.     dw     1024,    768, 0c010h,    074h +  00000h ; requires 2 Mb !!!
  138. ; To use the 16M modes, see note above (BJW)
  139.     dw    320,    200, 0c018h,    070h +    00000h
  140.     dw      640,    480, 0c018h,    071h +  00000h
  141.     dw        0,      0,      0,    000h +  00000h
  142.  
  143.  
  144. ;--------------------------------------------------------------------------
  145. ; TABLE OF SPECIAL SETUP PROCEDURES
  146. ;  You may need such procedures for:
  147. ;     -- reloading fonts on standard EGA or VGA for
  148. ;        higher resolution text modes
  149. ;     -- enable HiColor mode of some Super VGAs
  150. ;     -- Handle the parameter passing conventions of the VESA BIOS
  151. ;     -- put VGA into 256 color plane mode ("MODE X")
  152. ;     -- etc...
  153. ;  There should be one entry in the table for every non-zero
  154. ;  'setup_procedure_index' in the text and graphics mode tables.
  155. ;  The first entry in the table belongs to index 100h, and so on.
  156. ;  The special setup procedure is invoked via a near call.
  157. ;
  158. ;  Entry: DI=address of the mode record from the text or graphics
  159. ;         table to set up.
  160. ;
  161. ;  Exit:  Adapter configured
  162. ;         BX=driver mode word as it should be returned by the mode set
  163. ;            routine. Typically it involves picking up the mode word
  164. ;            from the header and OR-ing in the appropriate bitplane mode
  165. ;            bitfield. (This is not needed for text modes)
  166. ;         AX, CX, DX, SI can be trashed, PRESERVE DI!!!!
  167. ;
  168. ;  NOTE: This runs in real mode, but don't mess with the segment registers.
  169. ;--------------------------------------------------------------------------
  170. special_setup_table     label word
  171.     dw      offset  VGA_50row_mode_set
  172.  
  173. ;
  174. ; Routine to set up VGA 50 row mode
  175. ; interface is described above
  176. ;
  177. VGA_50row_mode_set      proc    near
  178.     mov     al,[di+6]               ; set 40x25 or 80x25 or 132x25 mode
  179.     xor     ah,ah
  180.     int     10h
  181.     xor     bx,bx
  182.     mov     ax,1112h                ; load 8x8 font
  183.     int     10h
  184.     ret
  185. VGA_50row_mode_set      endp
  186.  
  187.  
  188. ;--------------------------------------------------------------------------
  189. ; DRIVER INIT ROUTINE
  190. ;  called once after the driver is l